<%@page import="kau.dao.BoardDAOImpl"%>
<%@page import="kau.dao.CustomerDAOImpl"%>
<%@page import="kau.dao.CourseDAOImpl"%>
<%@page import="kau.dao.CurriculumDAOImpl"%>
<%@page import="kau.dao.WritingDAOImpl"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="java.util.*"%>
<%@ page import="kau.vo.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<%
	int bNumber1 = (Integer) session.getAttribute("bNumber1");
	int bNumber2 = (Integer) session.getAttribute("bNumber2");

	ArrayList<Writing> b1List = WritingDAOImpl.getInstance()
			.getAllWritings(bNumber1);
	ArrayList<Writing> b2List = WritingDAOImpl.getInstance()
			.getAllWritings(bNumber2);
%>

<style type="text/css">
#info {
	font-family: 맑은 고딕, dotum, sans-serif, bold;
	font-size: 13px
}
</style>



</head>
<body>

	<br>
	<div style="width: 700px" align="left" id="info">
		<br />
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<table width="638" height="172" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td colspan="3">
			<img src="/nems/course/img/courseMain-up_01.gif" width="638" height="11" alt=""></td>
	</tr>
	<tr>
	
	<% 
		int courseId = Integer.parseInt(session.getAttribute("courseId").toString());
		Course course = CourseDAOImpl.getInstance().getCourse(courseId); 
	    String overview = CurriculumDAOImpl.getInstance().getCurriculum(courseId).getOverview();
	    String instructorId = CourseDAOImpl.getInstance().getCourseInstructor(courseId);
	    Customer customer = null; 
	    if(instructorId==null){
	    	customer = new Customer();
	    	customer.setCustEmail("");
	    	customer.setCustName("");
	    }
	    else{
	    	customer = CustomerDAOImpl.getInstance().getCustomer(instructorId);
	    }
	    Board board = BoardDAOImpl.getInstance().getBoard(courseId, "공지사항");
	    int bNumber=board.getbNumber();
	%>
	
		<td rowspan="10">
			<img src="/nems/course/img/courseMain-up_02.gif" width="78" height="161" alt=""></td>
		<td width="307" height="27">
			<font
							style="font-size: 12px; font-family: Verdana, Geneva, sans-serif; color: black"><%=course.getCourseName() %></font></td>
		<td rowspan="10">
			<img src="/nems/course/img/courseMain-up_04.gif" width="253" height="161" alt=""></td>
	</tr>
	<tr>
		<td>
			<img src="/nems/course/img/courseMain-up_05.gif" width="307" height="4" alt=""></td>
	</tr>
	<tr>
		<td width="307" height="26">
			<font style="font-size: 12px; font-family: Verdana, Geneva, sans-serif; color: black">
			<%= overview%></font></td>
	</tr>
	<tr>
		<td>
			<img src="/nems/course/img/courseMain-up_07.gif" width="307" height="4" alt=""></td>
	</tr>
	<tr>
		<td width="307" height="28">
			<font
							style="font-size: 12px; font-family: Verdana, Geneva, sans-serif; color: black">
							<%=customer.getCustEmail() %></font></td>
	</tr>
	<tr>
		<td>
			<img src="/nems/course/img/courseMain-up_09.gif" width="307" height="4" alt=""></td>
	</tr>
	<tr>
		<td width="307" height="27">
			<font
							style="font-size: 12px; font-family: Verdana, Geneva, sans-serif; color: black">
							<%=customer.getCustName() %></font></td>
	</tr>
	<tr>
		<td>
			<img src="/nems/course/img/courseMain-up_11.gif" width="307" height="3" alt=""></td>
	</tr>
	<tr>
		<td  width="307" height="28">
		<font
							style="font-size: 12px; font-family: Verdana, Geneva, sans-serif; color: black">
							<%=course.getStartDate() %></font></td>
	</tr>
	<tr>
		<td>
			<img src="/nems/course/img/courseMain-up_13.gif" width="307" height="10" alt=""></td>
	</tr>
</table>
		<br />
		<table width="650" height="175" border="0" cellpadding="0"
			cellspacing="0">
			<tr>
				<td colspan="5"><img
					src="/nems/course/img/center-writing_01.gif" width="650" height="6"
					alt=""></td>
			</tr>
			<tr>
				<td colspan="2" rowspan="2"><img
					src="/nems/course/img/center-writing_02.gif" width="28" height="38"
					alt=""></td>
				<td width="255" height="27"><font
					style="font-size: 12px; font-family: Verdana, Geneva, sans-serif; color: #646362; font-weight: bold">&nbsp;공지사항</font></td>
				<td colspan="2" rowspan="2">
				
				<a href="/nems/list.writing?bNumber=<%=board.getbNumber() %>&courseId=<%=courseId%>"><img
					src="/nems/course/img/center-writing_04.gif" width="367" border="0"
					height="38" alt=""></a></td>
			</tr>
			<tr>
				<td><img src="/nems/course/img/center-writing_05.gif"
					width="255" height="11" alt=""></td>
			</tr>
			
			
			<% ArrayList<Writing> writingList = WritingDAOImpl.getInstance().getAllWritings(board.getbNumber()); %>
					
					
			<tr>
				<td rowspan="10"><img
					src="/nems/course/img/center-writing_06.gif" width="20"
					height="130" alt=""></td>
				<td colspan="3" width="616" height="23"><font
					style="font-size: 12px; font-family: Verdana, Geneva, sans-serif; color: #646362">
					<%if(writingList.size()>=1) {%><a href="/nems/showWriting.writing?wNumber=<%=writingList.get(0).getwNumber()%>&bNumber=<%=bNumber%>&courseId=<%=courseId%>" style="text-decoration: none;color: black;"><%=writingList.get(0).getTitle() %><%} %>
					</td>
				<td rowspan="10"><img
					src="/nems/course/img/center-writing_08.gif" width="14"
					height="130" alt=""></td>
			</tr>
			
			<tr>
				<td colspan="3"><img
					src="/nems/course/img/center-writing_09.gif" width="616" height="2"
					alt=""></td>
			</tr>
			<tr>
				<td colspan="3" width="616" height="21"><font
					style="font-size: 12px; font-family: Verdana, Geneva, sans-serif; color: #646362">
					<%if(writingList.size()>=2) {%><a href="/nems/showWriting.writing?wNumber=<%=writingList.get(1).getwNumber()%>&bNumber=<%=bNumber%>&courseId=<%=courseId%>" style="text-decoration: none;color: black;"><%=writingList.get(1).getTitle() %><%} %></font></td>
			</tr>
			
			<tr>
				<td colspan="3"><img
					src="/nems/course/img/center-writing_11.gif" width="616" height="2"
					alt=""></td>
			</tr>
			<tr>
				<td colspan="3" width="616" height="22"><font
					style="font-size: 12px; font-family: Verdana, Geneva, sans-serif; color: #646362">
					<%if(writingList.size()>=3) {%><a href="/nems/showWriting.writing?wNumber=<%=writingList.get(2).getwNumber()%>&bNumber=<%=bNumber%>&courseId=<%=courseId%>" style="text-decoration: none;color: black;"><%=writingList.get(2).getTitle() %><%} %></font></td>
			</tr>
			<tr>
				<td colspan="3"><img
					src="/nems/course/img/center-writing_13.gif" width="616" height="1"
					alt=""></td>
			</tr>
			<tr>
				<td colspan="3" width="616" height="22"><font
					style="font-size: 12px; font-family: Verdana, Geneva, sans-serif; color: #646362">
					<%if(writingList.size()>=4) {%><a href="/nems/showWriting.writing?wNumber=<%=writingList.get(3).getwNumber()%>&bNumber=<%=bNumber%>&courseId=<%=courseId%>" style="text-decoration: none;color: black;"><%=writingList.get(3).getTitle() %><%} %></font></td>
			</tr>
			<tr>
				<td colspan="3"><img
					src="/nems/course/img/center-writing_15.gif" width="616" height="2"
					alt=""></td>
			</tr>
			<tr>
				<td colspan="3" width="616" height="22"><font
					style="font-size: 12px; font-family: Verdana, Geneva, sans-serif; color: #646362">
					<%if(writingList.size()>=5) {%><a href="/nems/showWriting.writing?wNumber=<%=writingList.get(4).getwNumber()%>&bNumber=<%=bNumber%>&courseId=<%=courseId%>" style="text-decoration: none;color: black;"><%=writingList.get(4).getTitle() %><%} %></font></td>
			</tr>
			<tr>
				<td colspan="3"><img
					src="/nems/course/img/center-writing_17.gif" width="616"
					height="13" alt=""></td>
			</tr>
			<tr>
				<td><img
					src="/nems/course/img/&#xc2a4;&#xd398;&#xc774;&#xc11c;.gif"
					width="20" height="1" alt=""></td>
				<td><img
					src="/nems/course/img/&#xc2a4;&#xd398;&#xc774;&#xc11c;.gif"
					width="8" height="1" alt=""></td>
				<td><img
					src="/nems/course/img/&#xc2a4;&#xd398;&#xc774;&#xc11c;.gif"
					width="255" height="1" alt=""></td>
				<td><img
					src="/nems/course/img/&#xc2a4;&#xd398;&#xc774;&#xc11c;.gif"
					width="353" height="1" alt=""></td>
				<td><img
					src="/nems/course/img/&#xc2a4;&#xd398;&#xc774;&#xc11c;.gif"
					width="14" height="1" alt=""></td>
			</tr>
		</table>
		<br />
	</div>

</body>
</html>